package cn.mw.cmdb.param;

import cn.mw.cmdb.entity.DataAuth;
import cn.mw.cmdb.enums.MonitorFlagStatus;
import cn.mw.cmdb.service.ServiceChoose;
import cn.mw.cmdb.service.impl.InstanceServiceImpl;
import cn.mw.components.mongodb.anno.CMDBProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.List;

@Data
public class BatchEditorViewInstance extends DataAuth implements ServiceChoose {
    //启动配置状态
    @CMDBProperty
    private Boolean mw_monitorFlag;

    @CMDBProperty
    @Schema(description = "是否Trunk监控")
    private Boolean mw_trunkMonitorFlag;

    //root免密状态
    @CMDBProperty
    private String passwordFlag;

    //资产状态
    @CMDBProperty
    private String itemAssetsStatus;

    //视频在线状态
    @CMDBProperty
    private String mw_video_online_status;

    //视频状态
    @CMDBProperty
    private String mw_video_screen_status;

    //异常原因
    @CMDBProperty
    private String mw_video_abnormal_cause;

    //监控类型
    @CMDBProperty
    private String mw_monitorType;

    @CMDBProperty
    private List<String> functionModule;

    private List<String> instanceIds;

    //是否定时任务批量更新(true：定时任务，false：非定时任务)
    private Boolean timeTaskFlag;


    @Override
    public String getServiceId() {
        return InstanceServiceImpl.ID;
    }

    public MonitorFlagStatus getMonitorFlagStatus() {
        if (mw_monitorFlag!=null && mw_monitorFlag) {
            return MonitorFlagStatus.Enable;
        } else {
            return MonitorFlagStatus.Disable;
        }
    }
}
